LtU Forum, Site Discussion

Context Free: Grammars as Graphics

I'm pleased to announce the 1.0 release of Context Free: an environment for writing and rendering graphic design grammars for Mac OS X, Windows and Posix/Unix.

In Context Free, you write a context free grammar where the only two terminals are the shapes CIRCLE and SQUARE. Given a starting symbol, the program keeps expanding symbols that have rules until all that is left are terminal shapes, which are then drawn. In essence, the rendered images are legal sentences in the language described by your grammar!

Context Free is based on Chris Coyne's earlier CFDG, mentioned on LtU in the Fun department.

Competitive Collaborative Specification of GUI Applications through User Test Cases and Merit-Based Conflict Resolution

Now that we have considered how users can help each other avoid bugs in GUI applications, we would look to think about ways in which users can have more control in software development.

One idea is to develop a system to help millions of users collaboratively build and evolve a specification for a GUI app.

For example, how would a million users specify a paragraph formatting dialog box?

How would a million users specify the behavior of the cursor in a scientific word processor with math formulas, tables, etc.?

Some issues:

  • users may not agree; CollaborativeRank might help
  • users can build the GUI (a partial spec) using something like Qt designer and their combined work can then be used by the developers directly; issue: how to automatically combine their suggestions into a coherent GUI?
  • non-standard GUI elements (e.g., the main view of a scientific word processor), the specification by users can't be used directly; but it probably should be visual and should be something that can be mixed with a running GUI app (e.g., as a visual placeholder for something that is not implemented yet)
Some connections to existing ideas:
  • extreme programming: we could have users develop higher level visual test cases (e.g., before/after images of cursor movement); developers could then compete to satisfy those test cases; How do you automate a visual test case? Is machine learning helpful?
  • intentional programming: like IP, we can focus features; application boundaries may be nebulous; perhaps we could have automated forking and merging of applications
  • wikis: this is sort of like a wiki with visual placeholders for non-implemented parts
Is any of this novel?

DSL Error Handling in an Object Oriented context

I have been a lurker on LTU and have already learned a ton. I am currently developing an in house DSL, and I have come across a problem to which I haven't been able to find resources.

I am currently implementing the DSL in an object oriented language (ok, its Java, don't boo and hiss). I am not entirely sure how I should be handling errors that arise in the DSL (syntax errors, semantic errors). Is it enough for a log file? Should I have a DSLerror class of some sort?

Sorry if this is a naive question. DSL construction is a fascinating (yet relatively new) topic for me.

Thanks,

Michael

Archiving LISP history

Based on the progress I’ve made with FORTRAN, I decided to start another effort at the Computer History Museum to track down source code and documents for the original M.I.T. LISP I/1.5 project. I have made some progress, and am assembling a LISP web site at the Museum to organize and present the materials I’ve collected so far, including:

  • LISP 1.5: Assembly listing for IBM 709/7090 standalone system, and another for the CTSS port. Information about various other ports and reimplementations including Univac M-460, Q-32, and Univac 1108.
  • PDP-1 Lisp: links to the documentation, source code and simulators
  • MacLisp (PDP-6, PDP-10): links to documentatation and source code
  • BBN-LISP: the manual for the original PDP-1 version and the Tenex version (coming soon: preliminary specifications for the 940 version)
  • etc.

My hope for this project is to provide open online access to as much information as possible for students, historians, and other interested people.

Your comments are welcome (here, at my blog Dusty Decks, or by email. What am I missing? What facts have I gotten wrong? Please help fill in the gaps.

First public release of PyPy

PyPy 0.6, the first public version of PyPy, was released today.
http://codespeak.net/pypy/

From their announcement:

"PyPy is a MIT-licensed reimplementation of Python written in Python itself. The long term goals are an implementation that is flexible and easy to experiment with and retarget to different platforms (also non-C ones) and such that high performance can be achieved through high-level implementations of dynamic optimisation techniques."

LLVM 1.5 released with tail call optimization

From the release notes (http://llvm.cs.uiuc.edu/releases/1.5/docs/ReleaseNotes.html):

The release now includes support for proper tail calls, as required to implement languages like Scheme... In LLVM 1.5, the X86 code generator is the only target that has been enhanced to support proper tail calls (other targets will be enhanced in future). Further, because this support was added very close to the release, it is disabled by default. Pass -enable-x86-fastcc to llc to enable it (this will be enabled by default in the next release).

Is it time to create a PLT front-end for LLVM?
George

Funny characters inference

Aggressive Type Inference
In talking with people at last year's Python Conference (IPC7), I mentioned the possibility of writing a Python compiler... in Python. Not content to stop there, I suggested that the idea could be taken further, to translate Python code into Perl.
[...]
What does this have to do with type inference? The translated Perl code must have the $@%&* type specifiers on all Perl variables.
Can we look at this as a constructive proof that funny characters are (mostly) not needed by compiler, and are there only to please the programmers?

I decided against posting this in the thread that mentioned ugly syntax (not of Python), as it was pretty long and losing focus already.

tail recursion

Hello and sorry if this question has been already answered somewhere, though i searched for it.

The question is: tail-recursion is something badly needed _only_ in Scheme?

Here's a related question: if it isn't, that is, if it's possible to generally get compilers or interpreters to correctly detect recursion and automatically apply and implicit goto to it, then why should i bother, when it just complicates matters?

I gave a though to it when a saw a recent post here about LLVM and its recent support for tail-call for Scheme and also for playing with Haskell a bit.

So, to keep things simple, let's look at the examples:

;; in Scheme
(define (fact n)
  (define (product min max)
    (if (= min n)
	max
	(product (+ 1 min)
		 (* min max))))
  (product 1 n))

That's one way to look at a factorial, but not the _natural_, i guess.

-- in Haskell
-- and just to add a bit more argument
dec n = n - 1

fact 0 = 1
fact n = fact( dec n ) * n

That's the _natural_, let's call it that, high-school definition for factorial, pristine clear. There's no tail-call anywhere to be seen, and yet, it doesn't cause stack overflow with large numbers...

Am i missing something? or is Scheme being stubborn? R6RS is coming and perhaps should address it?

Sorry for being provocative, but it's a sincere question...

AST intermediate representations

Hi,

Is anyone aware of any systems which use AST intermediate representations instead of byte code? A few years ago, I read papers by Michael Franz concerning use of compressed ASTs in the Oberon system (e.g. A Tree Based Alternative to Java Byte Codes - pdf). Work on AST intermediate representations seems to have continued particularly in relation to mobile code (e.g. Towards Language-Agnostic Mobile Code - pdf).

Typically the AST intermediate representation of a program is compiled at the destination on the fly (with varying degrees of optimisation depending on time constraints). I'm interested in interpreting ASTs to see what the performance of AST interpretation is like as a first step (possibly with a subset of Oz). So far I've only found one attempt at anything like this.

Just wondering if LtU readers had come across any other work on AST representations and interpretation.

Regards,
Chris

LLVM 1.5 has been released!

Hi All,

This is a quick note to say that LLVM 1.5 is out, with many new features above and beyond LLVM 1.4. Perhaps the biggest feature of interest to this community is full support for proper tail calls, as described in the release notes. More details about the release can be found in the release notes and in the two status updates [1,2] since 1.4.

For those not familiar with LLVM, it is a compiler system that can be used to build a wide variety of compiler and language systems. It provides language- and target-independent tools for building static compilers, interprocedural optimizers, JITs, etc. If you are working on a new language and need a code generator, you should check it out. LLVM can be used in two ways: 1) link to the libraries we provide for direct access to the APIs. or 2) emit the LLVM IR as a text file. People have even written (toy) languages in perl using the second technique.

-Chris
XML feed